home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch6c < prev    next >
Encoding:
Internet Message Format  |  1989-11-27  |  59.7 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i056:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch6c
  5. Message-ID: <4845@tekred.CNA.TEK.COM>
  6. Date: 22 Nov 89 19:47:03 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2164
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 56
  13. Archive-name: NetHack3/Patch6c
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 3 (of 15)."
  25. # Contents:  UPDATE6 patches06f
  26. # Wrapped by billr@saab on Wed Nov 22 10:50:07 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'UPDATE6' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'UPDATE6'\"
  30. else
  31. echo shar: Extracting \"'UPDATE6'\" \(1267 characters\)
  32. sed "s/^X//" >'UPDATE6' <<'END_OF_FILE'
  33. XThis patch contains two major improvements:
  34. X
  35. XFirst, thanks to Ari Huttunen, different door states show up as different
  36. X(configurable) characters on the screen.
  37. X
  38. XSecond, doors can now be entered/exited diagonally both for player and
  39. Xmonster.
  40. X
  41. XThird, a gaggle of people credited in the appropriate files developed an
  42. Xoverlay manager for MS-DOS and MSC such that all the options of NetHack can
  43. Xbe supported.  See Install.dos and ovlmgr.* for further details.
  44. X
  45. XIn more minor news:
  46. X
  47. XYou no longer have to pick up food to eat it, and you no longer necessarily
  48. Xresume eating your interrupted meal.
  49. X
  50. XYou can no longer get properties from wielding a non-weapon.
  51. X
  52. XThere is a new option, CLIPPING, which allows playing on small screens or
  53. Xwindows.
  54. X
  55. XThe multiple demon types portion of HARD has been split off into the new
  56. XINFERNO option.
  57. X
  58. XThe Macintosh port has been further refined.
  59. X
  60. XThe / command now takes configurable characters into account when identifying
  61. Xitems.
  62. X
  63. XLeprechauns and lichs and nymphs and nagas had their letters switched so that
  64. Xthe more formidable monsters get capital letters.  Several new low-level
  65. Xmonsters were added.
  66. X
  67. XDrawbridge interactions are much smarter, thanks to Kevin Darcy.
  68. X
  69. XAnd a large number of minor bug fixes and efficiency enhancements.
  70. X
  71. END_OF_FILE
  72. if test 1267 -ne `wc -c <'UPDATE6'`; then
  73.     echo shar: \"'UPDATE6'\" unpacked with wrong size!
  74. fi
  75. # end of 'UPDATE6'
  76. fi
  77. if test -f 'patches06f' -a "${1}" != "-c" ; then 
  78.   echo shar: Will not clobber existing file \"'patches06f'\"
  79. else
  80. echo shar: Extracting \"'patches06f'\" \(55539 characters\)
  81. sed "s/^X//" >'patches06f' <<'END_OF_FILE'
  82. X*** src/Old/dog.c    Sun Nov 19 12:37:40 1989
  83. X--- src/dog.c    Wed Nov  8 22:56:30 1989
  84. X***************
  85. X*** 150,156 ****
  86. X  keepdogs(){
  87. X  register struct monst *mtmp;
  88. X      for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  89. X!         if(((dist(mtmp->mx,mtmp->my) < 3 && levl_follower(mtmp)) ||
  90. X          /* the wiz will level t-port from anywhere to chase
  91. X             the amulet; if you don't have it, will chase you
  92. X             only if in range. -3. */
  93. X--- 150,156 ----
  94. X  keepdogs(){
  95. X  register struct monst *mtmp;
  96. X      for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  97. X!         if(((monnear(mtmp, u.ux, u.uy) && levl_follower(mtmp)) ||
  98. X          /* the wiz will level t-port from anywhere to chase
  99. X             the amulet; if you don't have it, will chase you
  100. X             only if in range. -3. */
  101. X***************
  102. X*** 160,166 ****
  103. X          /* Bug "fix" for worm changing levels collapsing dungeon
  104. X           */
  105. X          if (mtmp->data == &mons[PM_LONG_WORM]) {
  106. X!             if (canseemon(mtmp) || (Blind && Telepat))
  107. X                  pline("The worm can't fit down the stairwell.");
  108. X  # ifdef WALKIES
  109. X              if (mtmp->mleashed) {
  110. X--- 160,166 ----
  111. X          /* Bug "fix" for worm changing levels collapsing dungeon
  112. X           */
  113. X          if (mtmp->data == &mons[PM_LONG_WORM]) {
  114. X!             if (showmon(mtmp))
  115. X                  pline("The worm can't fit down the stairwell.");
  116. X  # ifdef WALKIES
  117. X              if (mtmp->mleashed) {
  118. X***************
  119. X*** 244,256 ****
  120. X              return POISON;
  121. X              return (carni ? CADAVER : MANFOOD);
  122. X          case CORPSE:
  123. X!             if ((obj->age+50 <= moves && mon->data->mlet != S_FUNGUS) ||
  124. X              (poisonous(&mons[obj->corpsenm]) &&
  125. X                          !resists_poison(mon->data)))
  126. X              return POISON;
  127. X              else return (carni ? CADAVER : MANFOOD);
  128. X-         case DEAD_LIZARD:
  129. X-             return (carni ? ACCFOOD : MANFOOD);
  130. X          case CLOVE_OF_GARLIC:
  131. X              return (is_undead(mon->data) ? TABU :
  132. X                  (herbi ? ACCFOOD : MANFOOD));
  133. X--- 244,255 ----
  134. X              return POISON;
  135. X              return (carni ? CADAVER : MANFOOD);
  136. X          case CORPSE:
  137. X!             if ((obj->age+50 <= moves && obj->corpsenm != PM_LIZARD
  138. X!                         && mon->data->mlet != S_FUNGUS) ||
  139. X              (poisonous(&mons[obj->corpsenm]) &&
  140. X                          !resists_poison(mon->data)))
  141. X              return POISON;
  142. X              else return (carni ? CADAVER : MANFOOD);
  143. X          case CLOVE_OF_GARLIC:
  144. X              return (is_undead(mon->data) ? TABU :
  145. X                  (herbi ? ACCFOOD : MANFOOD));
  146. X*** src/Old/dogmove.c    Sun Nov 19 12:37:57 1989
  147. X--- src/dogmove.c    Sat Nov 11 17:05:22 1989
  148. X***************
  149. X*** 9,14 ****
  150. X--- 9,59 ----
  151. X  
  152. X  static const char nofetch[] = { BALL_SYM, CHAIN_SYM, ROCK_SYM, 0 };
  153. X  
  154. X+ static void
  155. X+ dog_eat(mtmp, obj, otyp, x, y)
  156. X+ register struct monst *mtmp;
  157. X+ register struct obj * obj;
  158. X+ xchar otyp;
  159. X+ int x, y;
  160. X+ {
  161. X+     register struct edog *edog = EDOG(mtmp);
  162. X+     int nutrit;
  163. X+ 
  164. X+     if(edog->hungrytime < moves)
  165. X+         edog->hungrytime = moves;
  166. X+     /* Note: to get the correct percentage-eaten in case oeaten is set,
  167. X+      * use "obj->owt / obj->quan / base-weight".  It so happens that here
  168. X+      * we want to multiply by obj->quan, which thus cancels out.
  169. X+      * It is arbitrary that the pet takes the same length of time to eat
  170. X+      * as a human, but gets 5X as much nutrition.
  171. X+      */
  172. X+     if(obj->otyp == CORPSE) {
  173. X+         mtmp->meating = 3 + (mons[obj->corpsenm].cwt >> 2);
  174. X+         nutrit = 5 * mons[obj->corpsenm].cnutrit;
  175. X+     } else {
  176. X+         mtmp->meating = objects[obj->otyp].oc_delay;
  177. X+         nutrit = 5 * objects[obj->otyp].nutrition;
  178. X+     }
  179. X+     if(obj->oeaten) {
  180. X+         mtmp->meating = eaten_stat(mtmp->meating, obj);
  181. X+         nutrit = eaten_stat(nutrit, obj);
  182. X+     }
  183. X+     edog->hungrytime += nutrit;
  184. X+     mtmp->mconf = 0;
  185. X+     if (mtmp->mtame < 20) mtmp->mtame++;
  186. X+     if(cansee(x,y))
  187. X+         pline("%s eats %s.", Monnam(mtmp), doname(obj));
  188. X+     /* perhaps this was a reward */
  189. X+     if(otyp != CADAVER)
  190. X+ #ifdef LINT
  191. X+         edog->apport = 0;
  192. X+ #else
  193. X+         edog->apport += (unsigned)(200L/
  194. X+         ((long)edog->dropdist+moves-edog->droptime));
  195. X+ #endif
  196. X+     delobj(obj);
  197. X+ }
  198. X+ 
  199. X  /* return 0 (no move), 1 (move) or 2 (dead) */
  200. X  int
  201. X  dog_move(mtmp, after)
  202. X***************
  203. X*** 32,41 ****
  204. X  
  205. X      omx = mtmp->mx;
  206. X      omy = mtmp->my;
  207. X!     whappr = (moves - EDOG(mtmp)->whistletime < 5);
  208. X!     if(moves > EDOG(mtmp)->hungrytime + 500) {
  209. X          if(!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
  210. X!             EDOG(mtmp)->hungrytime = moves + 500;
  211. X              /* but not too high; it might polymorph */
  212. X          } else if (!mtmp->mconf) {
  213. X              mtmp->mconf = 1;
  214. X--- 77,86 ----
  215. X  
  216. X      omx = mtmp->mx;
  217. X      omy = mtmp->my;
  218. X!     whappr = (moves - edog->whistletime < 5);
  219. X!     if(moves > edog->hungrytime + 500) {
  220. X          if(!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
  221. X!             edog->hungrytime = moves + 500;
  222. X              /* but not too high; it might polymorph */
  223. X          } else if (!mtmp->mconf) {
  224. X              mtmp->mconf = 1;
  225. X***************
  226. X*** 45,51 ****
  227. X              if(cansee(omx,omy))
  228. X                  pline("%s is confused from hunger.", Monnam(mtmp));
  229. X              else You("feel worried about %s.", mon_nam(mtmp));
  230. X!         } else if(moves > EDOG(mtmp)->hungrytime + 750 ||
  231. X                              mtmp->mhp < 1) {
  232. X  #ifdef WALKIES
  233. X              if(mtmp->mleashed)
  234. X--- 90,96 ----
  235. X              if(cansee(omx,omy))
  236. X                  pline("%s is confused from hunger.", Monnam(mtmp));
  237. X              else You("feel worried about %s.", mon_nam(mtmp));
  238. X!         } else if(moves > edog->hungrytime + 750 ||
  239. X                              mtmp->mhp < 1) {
  240. X  #ifdef WALKIES
  241. X              if(mtmp->mleashed)
  242. X***************
  243. X*** 85,91 ****
  244. X              if((otyp = dogfood(mtmp, obj)) <= CADAVER){
  245. X              nix = omx;
  246. X              niy = omy;
  247. X!             goto eatobj;
  248. X              }
  249. X              if(can_carry(mtmp, obj))
  250. X              if(rn2(20) < edog->apport+3)
  251. X--- 130,137 ----
  252. X              if((otyp = dogfood(mtmp, obj)) <= CADAVER){
  253. X              nix = omx;
  254. X              niy = omy;
  255. X!             dog_eat(mtmp, obj, otyp, nix, niy);
  256. X!             goto newdogpos;
  257. X              }
  258. X              if(can_carry(mtmp, obj))
  259. X              if(rn2(20) < edog->apport+3)
  260. X***************
  261. X*** 137,143 ****
  262. X          }
  263. X  
  264. X      if(gtyp == UNDEF ||
  265. X!       (gtyp != DOGFOOD && gtyp != APPORT && moves < EDOG(mtmp)->hungrytime)){
  266. X          if(dogroom < 0 || dogroom == uroom){
  267. X              gx = u.ux;
  268. X              gy = u.uy;
  269. X--- 183,189 ----
  270. X          }
  271. X  
  272. X      if(gtyp == UNDEF ||
  273. X!       (gtyp != DOGFOOD && gtyp != APPORT && moves < edog->hungrytime)){
  274. X          if(dogroom < 0 || dogroom == uroom){
  275. X              gx = u.ux;
  276. X              gy = u.uy;
  277. X***************
  278. X*** 246,308 ****
  279. X  
  280. X          /* dog eschews cursed objects */
  281. X          /* but likes dog food */
  282. X!         obj = fobj;
  283. X!         if(OBJ_AT(nx, ny)) 
  284. X!           while(obj){
  285. X!             if(obj->ox != nx || obj->oy != ny)
  286. X!             goto nextobj;
  287. X              if(obj->cursed && !mtmp->mleashed) goto nxti;
  288. X              if(obj->olet == FOOD_SYM &&
  289. X              (otyp = dogfood(mtmp, obj)) < MANFOOD &&
  290. X!             (otyp < ACCFOOD || EDOG(mtmp)->hungrytime <= moves)){
  291. X              /* Note: our dog likes the food so much that he
  292. X              might eat it even when it conceals a cursed object */
  293. X              nix = nx;
  294. X              niy = ny;
  295. X              chi = i;
  296. X!              eatobj:
  297. X!             if(EDOG(mtmp)->hungrytime < moves)
  298. X!                 EDOG(mtmp)->hungrytime = moves;
  299. X!             /* Note: to get the correct percentage-eaten in case
  300. X!              * oeaten is set, use "obj->owt / obj->quan /
  301. X!              * base-weight".  It so happens that here we want to
  302. X!              * multiply by obj->quan, which thus cancels out.
  303. X!              * It is arbitrary that the pet takes the same length
  304. X!              * of time to eat as a human, but gets 5X as much
  305. X!              * nutrition.
  306. X!              */
  307. X!             if(obj->otyp == CORPSE) {
  308. X!                 mtmp->meating =
  309. X!                 (3 + (mons[obj->corpsenm].cwt >> 2))
  310. X!                 * obj->owt / mons[obj->corpsenm].cwt;
  311. X!                 EDOG(mtmp)->hungrytime += 5 * 
  312. X!                 mons[obj->corpsenm].cnutrit
  313. X!                 * obj->owt / mons[obj->corpsenm].cwt;
  314. X!             } else {
  315. X!                 mtmp->meating =
  316. X!                 objects[obj->otyp].oc_delay
  317. X!                 * obj->owt / objects[obj->otyp].oc_weight;
  318. X!                 EDOG(mtmp)->hungrytime += 5 *
  319. X!                 objects[obj->otyp].nutrition
  320. X!                 * obj->owt / objects[obj->otyp].oc_weight;
  321. X!             }
  322. X!             mtmp->mconf = 0;
  323. X!             if (mtmp->mtame < 20) mtmp->mtame++;
  324. X!             if(cansee(nix,niy))
  325. X!                 pline("%s eats %s.", Monnam(mtmp), doname(obj));
  326. X!             /* perhaps this was a reward */
  327. X!             if(otyp != CADAVER)
  328. X! #ifdef LINT    /* edog->apport += (unsigned) (200L/((long) edog->dropdist...*/
  329. X!             edog->apport = 0;
  330. X! #else
  331. X!             edog->apport += (unsigned)(200L/
  332. X!                 ((long)edog->dropdist+moves-edog->droptime));
  333. X! #endif
  334. X!             delobj(obj);
  335. X              goto newdogpos;
  336. X              }
  337. X-         nextobj:
  338. X-             obj = obj->nobj;
  339. X          }
  340. X  
  341. X          for(j=0; j<MTSZ && j<cnt-1; j++)
  342. X--- 292,310 ----
  343. X  
  344. X          /* dog eschews cursed objects */
  345. X          /* but likes dog food */
  346. X!         for(obj = level.objects[nx][ny]; obj; obj = obj->nexthere) {
  347. X              if(obj->cursed && !mtmp->mleashed) goto nxti;
  348. X              if(obj->olet == FOOD_SYM &&
  349. X              (otyp = dogfood(mtmp, obj)) < MANFOOD &&
  350. X!             (otyp < ACCFOOD || edog->hungrytime <= moves)){
  351. X              /* Note: our dog likes the food so much that he
  352. X              might eat it even when it conceals a cursed object */
  353. X              nix = nx;
  354. X              niy = ny;
  355. X              chi = i;
  356. X!             dog_eat(mtmp, obj, otyp, nix, niy);
  357. X              goto newdogpos;
  358. X              }
  359. X          }
  360. X  
  361. X          for(j=0; j<MTSZ && j<cnt-1; j++)
  362. X*** src/Old/dokick.c    Sun Nov 19 12:38:19 1989
  363. X--- src/dokick.c    Sat Nov 18 23:06:56 1989
  364. X***************
  365. X*** 150,156 ****
  366. X      if(!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data)) && 
  367. X         mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) && 
  368. X         mon->data->mlet != S_EEL && haseyes(mon->data) && !mon->mfroz && 
  369. X!        !mon->mstun && !mon->mconf && mon->data->mmove >= 12) {
  370. X          if(!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
  371. X              kludge("%s blocks your %skick.", Monnam(mon), 
  372. X                  clumsy ? "clumsy " : "");
  373. X--- 150,157 ----
  374. X      if(!rn2(clumsy ? 3 : 4) && (clumsy || !bigmonst(mon->data)) && 
  375. X         mon->mcansee && !mon->mtrapped && !thick_skinned(mon->data) && 
  376. X         mon->data->mlet != S_EEL && haseyes(mon->data) && !mon->mfroz && 
  377. X!        !mon->mstun && !mon->mconf && !mon->msleep &&
  378. X!        mon->data->mmove >= 12) {
  379. X          if(!nohands(mon->data) && !rn2(martial() ? 5 : 3)) {
  380. X              kludge("%s blocks your %skick.", Monnam(mon), 
  381. X                  clumsy ? "clumsy " : "");
  382. X***************
  383. X*** 289,300 ****
  384. X      boolean costly = FALSE;
  385. X  
  386. X      /* if a pile, the "top" object gets kicked */
  387. X!     for (otmp = fobj; otmp; otmp = otmp->nobj)
  388. X!         if(otmp->ox == x && otmp->oy == y)
  389. X!             if(!otmp->cobj) {
  390. X!                 cnt++;
  391. X!                 if(cnt == 1) obj = otmp;
  392. X!             }
  393. X  
  394. X      /* range < 2 means the object will not move.    */
  395. X      /* maybe dexterity should also figure here.     */
  396. X--- 290,300 ----
  397. X      boolean costly = FALSE;
  398. X  
  399. X      /* if a pile, the "top" object gets kicked */
  400. X!     for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  401. X!         if(!otmp->cobj) {
  402. X!             cnt++;
  403. X!             if(cnt == 1) obj = otmp;
  404. X!         }
  405. X  
  406. X      /* range < 2 means the object will not move.    */
  407. X      /* maybe dexterity should also figure here.     */
  408. X***************
  409. X*** 302,309 ****
  410. X                  ACURR(A_STR))/2 - obj->owt/4);
  411. X      else range = rnd((int)ACURR(A_STR));
  412. X  
  413. X-     if(range < 1) range = 1; /* safety... */
  414. X      if(martial()) range = range + rnd(3);
  415. X  
  416. X      /* see if the object has a place to move into */
  417. X      odx = x + u.dx;
  418. X--- 302,309 ----
  419. X                  ACURR(A_STR))/2 - obj->owt/4);
  420. X      else range = rnd((int)ACURR(A_STR));
  421. X  
  422. X      if(martial()) range = range + rnd(3);
  423. X+     if(range < 1) range = 1; /* safety... */
  424. X  
  425. X      /* see if the object has a place to move into */
  426. X      odx = x + u.dx;
  427. X***************
  428. X*** 355,361 ****
  429. X          return(1);
  430. X      }
  431. X  
  432. X!     if(obj->otyp == BOULDER || obj == uball || obj == uchain)
  433. X          return(0);
  434. X  
  435. X      /* a box gets a chance of breaking open here */
  436. X--- 355,363 ----
  437. X          return(1);
  438. X      }
  439. X  
  440. X!     /* cnt should always be >= 1 here (meaning obj is set) due to
  441. X!      * conditions of call */
  442. X!     if(!cnt || obj->otyp == BOULDER || obj == uball || obj == uchain)
  443. X          return(0);
  444. X  
  445. X      /* a box gets a chance of breaking open here */
  446. X***************
  447. X*** 365,380 ****
  448. X          if (!obj->olocked && (!rn2(3) ||
  449. X                      (martial() && !rn2(2)))) {
  450. X              pline("The lid slams open, then falls shut.");
  451. X!             if(otrp) goto gotcha;
  452. X              return(1);
  453. X          } else if (obj->olocked && 
  454. X                  (!rn2(5) || (martial() && !rn2(2)))) {
  455. X              You("break open the lock!");
  456. X              obj->olocked = 0;
  457. X!                 if(otrp) {
  458. X! gotcha:
  459. X!                 chest_trap(obj, LEG);
  460. X!             }
  461. X              return(1);
  462. X          }
  463. X          /* let it fall through to the next cases... */
  464. X--- 367,379 ----
  465. X          if (!obj->olocked && (!rn2(3) ||
  466. X                      (martial() && !rn2(2)))) {
  467. X              pline("The lid slams open, then falls shut.");
  468. X!             if(otrp) chest_trap(obj, LEG);
  469. X              return(1);
  470. X          } else if (obj->olocked && 
  471. X                  (!rn2(5) || (martial() && !rn2(2)))) {
  472. X              You("break open the lock!");
  473. X              obj->olocked = 0;
  474. X!                 if(otrp) chest_trap(obj, LEG);
  475. X              return(1);
  476. X          }
  477. X          /* let it fall through to the next cases... */
  478. X***************
  479. X*** 393,402 ****
  480. X      /* potions get a chance of breaking here */
  481. X      if(obj->olet == POTION_SYM) {
  482. X          if(rn2(2)) {
  483. X!             You("smash the %s!", xname(obj));
  484. X!             if(costly) addtobill(obj, FALSE);
  485. X              potionbreathe(obj);
  486. X!             delobj(obj);
  487. X              return(1);
  488. X          }
  489. X      }
  490. X--- 392,400 ----
  491. X      /* potions get a chance of breaking here */
  492. X      if(obj->olet == POTION_SYM) {
  493. X          if(rn2(2)) {
  494. X!             You("smash %s %s!", obj->quan==1 ? "the" : "a", xname(obj));
  495. X              potionbreathe(obj);
  496. X!             useupf(obj);
  497. X              return(1);
  498. X          }
  499. X      }
  500. X***************
  501. X*** 438,443 ****
  502. X--- 436,443 ----
  503. X          return(0);
  504. X      }
  505. X  
  506. X+     if (obj->quan > 1) (void) splitobj(obj, 1);
  507. X+ 
  508. X      /* Needed to fool bhit's display-cleanup to show immediately    */
  509. X      /* the next object in the pile.  We know here that the object    */
  510. X      /* will move, so there is no need to worry about the location,    */
  511. X***************
  512. X*** 448,453 ****
  513. X--- 448,454 ----
  514. X  
  515. X      mon = bhit(u.dx, u.dy, range, obj->olet,
  516. X              (int (*)()) 0, (int (*)()) 0, obj);
  517. X+     freeobj(obj);
  518. X      if(mon) {
  519. X  # ifdef WORM
  520. X          if (mon->mx != bhitpos.x || mon->my != bhitpos.y)
  521. X***************
  522. X*** 459,464 ****
  523. X--- 460,467 ----
  524. X      }
  525. X      if(costly && !costly_spot(bhitpos.x,bhitpos.y)) addtobill(obj, FALSE);
  526. X      move_object(obj, bhitpos.x, bhitpos.y);
  527. X+     obj->nobj = fobj;
  528. X+     fobj = obj;
  529. X      stackobj(obj);
  530. X      if(!MON_AT(obj->ox, obj->oy))
  531. X          newsym(obj->ox, obj->oy);
  532. X***************
  533. X*** 548,559 ****
  534. X              if(rn2(30) < avrg_attrib) { 
  535. X              pline("Crash!  You kick open a secret door!");
  536. X              maploc->typ = DOOR;
  537. X-             atl(x, y, (char) DOOR_SYM);
  538. X              if(maploc->doormask & D_TRAPPED) {
  539. X                  b_trapped("door");
  540. X                  maploc->doormask = D_NODOOR;
  541. X              } else
  542. X                  maploc->doormask = D_ISOPEN;
  543. X              return(1);
  544. X              } else goto ouch;
  545. X          }
  546. X--- 551,563 ----
  547. X              if(rn2(30) < avrg_attrib) { 
  548. X              pline("Crash!  You kick open a secret door!");
  549. X              maploc->typ = DOOR;
  550. X              if(maploc->doormask & D_TRAPPED) {
  551. X                  b_trapped("door");
  552. X                  maploc->doormask = D_NODOOR;
  553. X              } else
  554. X                  maploc->doormask = D_ISOPEN;
  555. X+             mnewsym(x,y);
  556. X+             prl(x,y);
  557. X              return(1);
  558. X              } else goto ouch;
  559. X          }
  560. X***************
  561. X*** 561,567 ****
  562. X              if(rn2(30) < avrg_attrib) { 
  563. X              pline("Crash!  You kick open a secret passage!");
  564. X              maploc->typ = CORR;
  565. X!             atl(x, y, (char) CORR_SYM);
  566. X              return(1);
  567. X              } else goto ouch;
  568. X          }
  569. X--- 565,572 ----
  570. X              if(rn2(30) < avrg_attrib) { 
  571. X              pline("Crash!  You kick open a secret passage!");
  572. X              maploc->typ = CORR;
  573. X!             mnewsym(x,y);
  574. X!             prl(x,y);
  575. X              return(1);
  576. X              } else goto ouch;
  577. X          }
  578. X***************
  579. X*** 575,581 ****
  580. X              mkgold((long)rnd(200), x, y);
  581. X              prl(x, y);
  582. X              return(1);
  583. X!             } else if(u.uluck && !rn2(3) && !maploc->doormask) {
  584. X              You("kick loose some ornamental coins and gems!");
  585. X              mkgold((300L+(long)rn2(201)), x, y);
  586. X              i = u.uluck + 1;
  587. X--- 580,586 ----
  588. X              mkgold((long)rnd(200), x, y);
  589. X              prl(x, y);
  590. X              return(1);
  591. X!             } else if(u.uluck && !rn2(3) && !maploc->looted) {
  592. X              You("kick loose some ornamental coins and gems!");
  593. X              mkgold((300L+(long)rn2(201)), x, y);
  594. X              i = u.uluck + 1;
  595. X***************
  596. X*** 583,589 ****
  597. X              while(i--) (void) mkobj_at(GEM_SYM, x, y);
  598. X              prl(x, y);
  599. X              /* prevent endless milking */
  600. X!             maploc->doormask = T_LOOTED; 
  601. X              return(1);
  602. X              } else if (!rn2(4)) {
  603. X              register struct trap *ttmp = 
  604. X--- 588,594 ----
  605. X              while(i--) (void) mkobj_at(GEM_SYM, x, y);
  606. X              prl(x, y);
  607. X              /* prevent endless milking */
  608. X!             maploc->looted = T_LOOTED;
  609. X              return(1);
  610. X              } else if (!rn2(4)) {
  611. X              register struct trap *ttmp = 
  612. X***************
  613. X*** 617,623 ****
  614. X                    Hallucination ? hcolor() : black);
  615. X              pmon(makemon(&mons[PM_BLACK_PUDDING], x, y));
  616. X              return(1);
  617. X! #  ifdef HARD
  618. X              } else if(!rn2(3) &&
  619. X  #   ifndef POLYSELF
  620. X                    poly_gender() != 2 &&
  621. X--- 622,628 ----
  622. X                    Hallucination ? hcolor() : black);
  623. X              pmon(makemon(&mons[PM_BLACK_PUDDING], x, y));
  624. X              return(1);
  625. X! #  ifdef INFERNO
  626. X              } else if(!rn2(3) &&
  627. X  #   ifndef POLYSELF
  628. X                    poly_gender() != 2 &&
  629. X***************
  630. X*** 630,641 ****
  631. X  #  endif
  632. X              } else if(!rn2(3)) {
  633. X              pline("Flupp!  Muddy waste pops up from the drain.");
  634. X!             if(!maploc->doormask) { /* only once per sink */
  635. X                  if(!Blind) 
  636. X                  You("see a ring shining in its midst.");
  637. X                  (void) mkobj_at(RING_SYM, x, y);
  638. X                  prl(x, y);
  639. X!                 maploc->doormask = T_LOOTED;
  640. X              }
  641. X              return(1);
  642. X              }
  643. X--- 635,646 ----
  644. X  #  endif
  645. X              } else if(!rn2(3)) {
  646. X              pline("Flupp!  Muddy waste pops up from the drain.");
  647. X!             if(!maploc->looted) { /* only once per sink */
  648. X                  if(!Blind) 
  649. X                  You("see a ring shining in its midst.");
  650. X                  (void) mkobj_at(RING_SYM, x, y);
  651. X                  prl(x, y);
  652. X!                 maploc->looted = T_LOOTED;
  653. X              }
  654. X              return(1);
  655. X              }
  656. X***************
  657. X*** 692,700 ****
  658. X          } else {
  659. X              pline("As you kick the door, it crashes open!");
  660. X              maploc->doormask = D_BROKEN;
  661. X!             if(in_shop(x, y) && !in_shop(u.ux, u.uy))
  662. X              pay_for_door(x, y, "break");
  663. X          }
  664. X      } else    pline("WHAMMM!!!");
  665. X  
  666. X      return(1);
  667. X--- 697,707 ----
  668. X          } else {
  669. X              pline("As you kick the door, it crashes open!");
  670. X              maploc->doormask = D_BROKEN;
  671. X!             if(in_shop(x, y))
  672. X              pay_for_door(x, y, "break");
  673. X          }
  674. X+         mnewsym(x,y);
  675. X+         prl(x,y);
  676. X      } else    pline("WHAMMM!!!");
  677. X  
  678. X      return(1);
  679. X*** src/Old/dothrow.c    Sun Nov 19 12:38:45 1989
  680. X--- src/dothrow.c    Fri Nov 17 19:31:32 1989
  681. X***************
  682. X*** 1,4 ****
  683. X! /*    SCCS Id: @(#)dothrow.c    3.0    88/10/22
  684. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  685. X  /* NetHack may be freely redistributed.  See license for details. */
  686. X  
  687. X--- 1,4 ----
  688. X! /*    SCCS Id: @(#)dothrow.c    3.0    89/11/15
  689. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  690. X  /* NetHack may be freely redistributed.  See license for details. */
  691. X  
  692. X***************
  693. X*** 6,13 ****
  694. X  
  695. X  #include "hack.h"
  696. X  
  697. X! static void gem_accept P((struct monst *, struct obj *));
  698. X! static int throw_gold P((struct obj *));
  699. X  static const char toss_objs[] = { '0', GOLD_SYM, '#', WEAPON_SYM, 0 };
  700. X  #ifdef WORM
  701. X  extern boolean notonhead;
  702. X--- 6,13 ----
  703. X  
  704. X  #include "hack.h"
  705. X  
  706. X! static void FDECL(gem_accept, (struct monst *, struct obj *));
  707. X! static int FDECL(throw_gold, (struct obj *));
  708. X  static const char toss_objs[] = { '0', GOLD_SYM, '#', WEAPON_SYM, 0 };
  709. X  #ifdef WORM
  710. X  extern boolean notonhead;
  711. X***************
  712. X*** 255,261 ****
  713. X          }
  714. X          return(1);
  715. X      }
  716. X!     if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE || obj->olet == GEM_SYM) {
  717. X          if(obj->otyp < DART || obj->olet == GEM_SYM) {
  718. X              if (!uwep ||
  719. X              objects[obj->otyp].w_propellor !=
  720. X--- 255,262 ----
  721. X          }
  722. X          return(1);
  723. X      }
  724. X!     if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE ||
  725. X!        obj->otyp == UNICORN_HORN || obj->olet == GEM_SYM) {
  726. X          if(obj->otyp < DART || obj->olet == GEM_SYM) {
  727. X              if (!uwep ||
  728. X              objects[obj->otyp].w_propellor !=
  729. X*** src/Old/eat.c    Sun Nov 19 12:39:11 1989
  730. X--- src/eat.c    Sat Nov 18 18:18:49 1989
  731. X***************
  732. X*** 1,4 ****
  733. X! /*    SCCS Id: @(#)eat.c    3.0    88/10/22
  734. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  735. X  /* NetHack may be freely redistributed.  See license for details. */
  736. X  
  737. X--- 1,4 ----
  738. X! /*    SCCS Id: @(#)eat.c    3.0    89/11/15
  739. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  740. X  /* NetHack may be freely redistributed.  See license for details. */
  741. X  
  742. X***************
  743. X*** 5,22 ****
  744. X  #include    "hack.h"
  745. X  /*#define DEBUG     /* uncomment to enable new eat code debugging */
  746. X  
  747. X! static int fpostfx P((struct obj *));
  748. X! static int cpostfx P((int));
  749. X  
  750. X  char corpsename[60];
  751. X  char msgbuf[BUFSZ];
  752. X  
  753. X  /* hunger texts used on bottom line (each 8 chars long) */
  754. X! #define    SATIATED    0
  755. X  #define NOT_HUNGRY    1
  756. X! #define    HUNGRY        2
  757. X! #define    WEAK        3
  758. X! #define    FAINTING    4
  759. X  #define FAINTED        5
  760. X  #define STARVED        6
  761. X  
  762. X--- 5,30 ----
  763. X  #include    "hack.h"
  764. X  /*#define DEBUG     /* uncomment to enable new eat code debugging */
  765. X  
  766. X! #ifdef DEBUG
  767. X! # ifdef WIZARD
  768. X! #define debug    if (wizard) pline
  769. X! # else
  770. X! #define debug    pline
  771. X! # endif
  772. X! #endif
  773. X! 
  774. X! static void FDECL(fpostfx, (struct obj *));
  775. X! static void FDECL(cpostfx, (int));
  776. X  
  777. X  char corpsename[60];
  778. X  char msgbuf[BUFSZ];
  779. X  
  780. X  /* hunger texts used on bottom line (each 8 chars long) */
  781. X! #define SATIATED    0
  782. X  #define NOT_HUNGRY    1
  783. X! #define HUNGRY        2
  784. X! #define WEAK        3
  785. X! #define FAINTING    4
  786. X  #define FAINTED        5
  787. X  #define STARVED        6
  788. X  
  789. X***************
  790. X*** 34,50 ****
  791. X  
  792. X  /* calculate x/y, rounding as appropriate */
  793. X  
  794. X! static int
  795. X  rounddiv(x, y)
  796. X! int x, y;
  797. X  {
  798. X!     int divsgn;
  799. X!     int r, m;
  800. X  
  801. X      if (y == 0)
  802. X          panic("division by zero in rounddiv");
  803. X!     divsgn = (x*y > 0) ? 1 : -1;
  804. X!     x = abs(x); y = abs(y);
  805. X      r = x/y;
  806. X      m = x%y;
  807. X      if (2*m >= y)
  808. X--- 42,62 ----
  809. X  
  810. X  /* calculate x/y, rounding as appropriate */
  811. X  
  812. X! static long
  813. X  rounddiv(x, y)
  814. X! long x, y;
  815. X  {
  816. X!     int divsgn = 1;
  817. X!     long r, m;
  818. X  
  819. X      if (y == 0)
  820. X          panic("division by zero in rounddiv");
  821. X!     if (x < 0) {
  822. X!         divsgn = -divsgn; x = -x;
  823. X!     }
  824. X!     if (y < 0) {
  825. X!         divsgn = -divsgn; y = -y;
  826. X!     }
  827. X      r = x/y;
  828. X      m = x%y;
  829. X      if (2*m >= y)
  830. X***************
  831. X*** 79,86 ****
  832. X                   * a tin, which uses the tin structure above */
  833. X      int    usedtime,    /* turns spent eating */
  834. X          reqtime;    /* turns required to eat */
  835. X!     int    nutrit,        /* total nutrition at beginning */
  836. X!         nmod;        /* coded nutrition per turn */
  837. X      Bitfield(canchoke,1);    /* was satiated at beginning */
  838. X      Bitfield(fullwarn,1);    /* have warned about being full */
  839. X      Bitfield(eating,1);    /* victual currently being eaten */
  840. X--- 91,97 ----
  841. X                   * a tin, which uses the tin structure above */
  842. X      int    usedtime,    /* turns spent eating */
  843. X          reqtime;    /* turns required to eat */
  844. X!     int    nmod;        /* coded nutrition per turn */
  845. X      Bitfield(canchoke,1);    /* was satiated at beginning */
  846. X      Bitfield(fullwarn,1);    /* have warned about being full */
  847. X      Bitfield(eating,1);    /* victual currently being eaten */
  848. X***************
  849. X*** 87,93 ****
  850. X      Bitfield(doreset,1);    /* stop eating at end of turn */
  851. X  } victual;
  852. X  
  853. X! static int
  854. X  Meatdone() {        /* called after mimicing is over */
  855. X      u.usym =
  856. X  #ifdef POLYSELF
  857. X--- 98,107 ----
  858. X      Bitfield(doreset,1);    /* stop eating at end of turn */
  859. X  } victual;
  860. X  
  861. X! #ifndef OVERLAY
  862. X! static 
  863. X! #endif
  864. X! int
  865. X  Meatdone() {        /* called after mimicing is over */
  866. X      u.usym =
  867. X  #ifdef POLYSELF
  868. X***************
  869. X*** 101,110 ****
  870. X  /* Created by GAN 01/28/87
  871. X   * Amended by AKP 09/22/87: if not hard, don't choke, just vomit.
  872. X   * Amended by 3.  06/12/89: if not hard, sometimes choke anyway, to keep risk.
  873. X   */
  874. X  /*ARGSUSED*/
  875. X  static void
  876. X! choke(food)
  877. X      register struct obj *food;
  878. X  {
  879. X      /* only happens if you were satiated */
  880. X--- 115,125 ----
  881. X  /* Created by GAN 01/28/87
  882. X   * Amended by AKP 09/22/87: if not hard, don't choke, just vomit.
  883. X   * Amended by 3.  06/12/89: if not hard, sometimes choke anyway, to keep risk.
  884. X+  *          11/10/89: if hard, rarely vomit anyway, for slim chance.
  885. X   */
  886. X  /*ARGSUSED*/
  887. X  static void
  888. X! choke(food)    /* To a full belly all food is bad. (It.) */
  889. X      register struct obj *food;
  890. X  {
  891. X      /* only happens if you were satiated */
  892. X***************
  893. X*** 113,152 ****
  894. X      if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL)
  895. X          u.ualign--;    /* gluttony is unchivalrous */
  896. X  
  897. X! #ifndef HARD
  898. X      if (rn2(20)) {
  899. X          You("stuff yourself and then vomit voluminously.");
  900. X          morehungry(1000);    /* you just got *very* sick! */
  901. X          vomit();
  902. X      } else {
  903. X- #endif
  904. X          if(food) {
  905. X!             killer = singular(food);
  906. X          } else
  907. X              killer = "exuberant appetite";
  908. X          You("choke over your food.");
  909. X          You("die...");
  910. X          done(CHOKING);
  911. X- #ifndef HARD
  912. X      }
  913. X- #endif
  914. X  }
  915. X  
  916. X  static void
  917. X  recalc_wt() {    /* modify object wt. depending on time spent consuming it */
  918. X!     int baseweight = weight(victual.piece);    /* weight of full item */
  919. X  
  920. X  #ifdef DEBUG
  921. X!     pline("Old weight = %d", victual.piece->owt);
  922. X!     pline("Used time = %d, Req'd time = %d",
  923. X          victual.usedtime, victual.reqtime);
  924. X  #endif
  925. X!     if(victual.usedtime)
  926. X!         victual.piece->owt = (unsigned)rounddiv(
  927. X!                 baseweight * (victual.reqtime - victual.usedtime),
  928. X!                 victual.reqtime );
  929. X  #ifdef DEBUG
  930. X!     pline("New weight = %d", victual.piece->owt);
  931. X  #endif
  932. X  }
  933. X  
  934. X--- 128,166 ----
  935. X      if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL)
  936. X          u.ualign--;    /* gluttony is unchivalrous */
  937. X  
  938. X! #ifdef HARD
  939. X!     if (!rn2(20)) {
  940. X! #else
  941. X      if (rn2(20)) {
  942. X+ #endif
  943. X          You("stuff yourself and then vomit voluminously.");
  944. X          morehungry(1000);    /* you just got *very* sick! */
  945. X          vomit();
  946. X      } else {
  947. X          if(food) {
  948. X!             killer = singular(food, xname);
  949. X          } else
  950. X              killer = "exuberant appetite";
  951. X          You("choke over your food.");
  952. X          You("die...");
  953. X          done(CHOKING);
  954. X      }
  955. X  }
  956. X  
  957. X  static void
  958. X  recalc_wt() {    /* modify object wt. depending on time spent consuming it */
  959. X!     register struct obj *piece = victual.piece;
  960. X  
  961. X  #ifdef DEBUG
  962. X!     debug("Old weight = %d", piece->owt);
  963. X!     debug("Used time = %d, Req'd time = %d",
  964. X          victual.usedtime, victual.reqtime);
  965. X  #endif
  966. X!     /* weight(piece) = weight of full item */
  967. X!       if(victual.usedtime)
  968. X!         piece->owt = eaten_stat(weight(piece), piece);
  969. X  #ifdef DEBUG
  970. X!     debug("New weight = %d", piece->owt);
  971. X  #endif
  972. X  }
  973. X  
  974. X***************
  975. X*** 158,164 ****
  976. X       */
  977. X      if(victual.eating && !victual.doreset) {
  978. X  #ifdef DEBUG
  979. X!         pline("reset_eat...");
  980. X  #endif
  981. X          victual.doreset = TRUE;
  982. X      }
  983. X--- 172,178 ----
  984. X       */
  985. X      if(victual.eating && !victual.doreset) {
  986. X  #ifdef DEBUG
  987. X!         debug("reset_eat...");
  988. X  #endif
  989. X          victual.doreset = TRUE;
  990. X      }
  991. X***************
  992. X*** 169,191 ****
  993. X  touchfood(otmp)
  994. X  register struct obj *otmp;
  995. X  {
  996. X!     if(otmp->quan > 1) {
  997. X! 
  998. X          otmp = splitobj(otmp, (int)otmp->quan-1);
  999. X  #ifdef DEBUG
  1000. X!         pline("split object,");
  1001. X  #endif
  1002. X! 
  1003. X!         otmp->oeaten = TRUE;
  1004. X!         if(carried(otmp)) {
  1005. X!         freeinv(otmp);
  1006. X!         if(inv_cnt() >= 52)
  1007. X!             dropy(otmp);
  1008. X!         else
  1009. X!             otmp = addinv(otmp); /* unlikely but a merge is possible */
  1010. X!         }
  1011. X!     } else
  1012. X!         otmp->oeaten = TRUE;
  1013. X      return(otmp);
  1014. X  }
  1015. X  
  1016. X--- 183,205 ----
  1017. X  touchfood(otmp)
  1018. X  register struct obj *otmp;
  1019. X  {
  1020. X!     if (otmp->quan > 1) {
  1021. X          otmp = splitobj(otmp, (int)otmp->quan-1);
  1022. X  #ifdef DEBUG
  1023. X!         debug("split object,");
  1024. X  #endif
  1025. X!     }
  1026. X!     if (!otmp->oeaten)
  1027. X!         otmp->oeaten = (otmp->otyp == CORPSE ?
  1028. X!                 (int)mons[otmp->corpsenm].cnutrit :
  1029. X!                 objects[otmp->otyp].nutrition);
  1030. X!     if (carried(otmp)) {
  1031. X!         freeinv(otmp);
  1032. X!         if(inv_cnt() >= 52)
  1033. X!         dropy(otmp);
  1034. X!         else
  1035. X!         otmp = addinv(otmp); /* unlikely but a merge is possible */
  1036. X!     }
  1037. X      return(otmp);
  1038. X  }
  1039. X  
  1040. X***************
  1041. X*** 193,199 ****
  1042. X  do_reset_eat() {
  1043. X  
  1044. X  #ifdef DEBUG
  1045. X!     pline("do_reset_eat...");
  1046. X  #endif
  1047. X      victual.piece = touchfood(victual.piece);
  1048. X      recalc_wt();
  1049. X--- 207,213 ----
  1050. X  do_reset_eat() {
  1051. X  
  1052. X  #ifdef DEBUG
  1053. X!     debug("do_reset_eat...");
  1054. X  #endif
  1055. X      victual.piece = touchfood(victual.piece);
  1056. X      recalc_wt();
  1057. X***************
  1058. X*** 202,216 ****
  1059. X      stop_occupation();
  1060. X  }
  1061. X  
  1062. X! static int
  1063. X  eatfood() {        /* called each move during eating process */
  1064. X! 
  1065. X      if(!victual.eating) return(0);
  1066. X      if(victual.usedtime++ < victual.reqtime) {
  1067. X      /* You can only choke if you were satiated before you started
  1068. X       * eating.
  1069. X       */
  1070. X!         if(victual.canchoke && u.uhunger >= 2000) choke(victual.piece);
  1071. X  
  1072. X          if(victual.nmod < 0)
  1073. X          lesshungry(-victual.nmod);
  1074. X--- 216,241 ----
  1075. X      stop_occupation();
  1076. X  }
  1077. X  
  1078. X! #ifndef OVERLAY
  1079. X! static 
  1080. X! #endif
  1081. X! int
  1082. X  eatfood() {        /* called each move during eating process */
  1083. X!     if(!carried(victual.piece) && !obj_here(victual.piece, u.ux, u.uy)) {
  1084. X!         /* maybe it was stolen? */
  1085. X!         do_reset_eat();
  1086. X!         return(0);
  1087. X!     }
  1088. X      if(!victual.eating) return(0);
  1089. X      if(victual.usedtime++ < victual.reqtime) {
  1090. X      /* You can only choke if you were satiated before you started
  1091. X       * eating.
  1092. X       */
  1093. X!         if(victual.canchoke && u.uhunger >= 2000) {
  1094. X!         choke(victual.piece);
  1095. X!         do_reset_eat(); /* if they were lifesaved, stop eating */
  1096. X!         return 0;
  1097. X!         }
  1098. X  
  1099. X          if(victual.nmod < 0)
  1100. X          lesshungry(-victual.nmod);
  1101. X***************
  1102. X*** 218,240 ****
  1103. X          lesshungry(1);
  1104. X  
  1105. X          if(victual.doreset) do_reset_eat();
  1106. X          return 1;    /* still busy */
  1107. X      } else {    /* done */
  1108. X! 
  1109. X!         register int tp;
  1110. X  
  1111. X          if(victual.piece->otyp == CORPSE)
  1112. X!         tp = cpostfx(victual.piece->corpsenm);
  1113. X          else
  1114. X!         tp = fpostfx(victual.piece);
  1115. X! 
  1116. X!         You("finish eating the %s.", singular(victual.piece));
  1117. X  
  1118. X!         useup(victual.piece);
  1119. X          victual.piece = (struct obj *) 0;
  1120. X          victual.fullwarn = victual.eating = victual.doreset = 
  1121. X          victual.canchoke = FALSE;
  1122. X!         return(tp);
  1123. X      }
  1124. X  }
  1125. X  
  1126. X--- 243,283 ----
  1127. X          lesshungry(1);
  1128. X  
  1129. X          if(victual.doreset) do_reset_eat();
  1130. X+         else {
  1131. X+         /* We have to calculate this every move--sometimes the thing
  1132. X+          * which interrupts eating also needs to know the state of your
  1133. X+          * food, so it's no good to recalculate the state of your food
  1134. X+          * only after you stopped eating.  Currently, the only meal-
  1135. X+          * interruptor which needs to know it is troll revivication,
  1136. X+          * and it only needs to know oeaten and the weight.
  1137. X+          */
  1138. X+         if (victual.nmod < 0)
  1139. X+             victual.piece->oeaten -= -victual.nmod;
  1140. X+         else if (victual.nmod > 0 && (victual.usedtime % victual.nmod))
  1141. X+             victual.piece->oeaten--;
  1142. X+         recalc_wt();
  1143. X+         }
  1144. X          return 1;    /* still busy */
  1145. X      } else {    /* done */
  1146. X! #ifndef NO_SIGNAL
  1147. X!         victual.piece->in_use = TRUE;
  1148. X! #endif
  1149. X!         if (nomovemsg) {
  1150. X!         pline(nomovemsg);
  1151. X!         nomovemsg = 0;
  1152. X!         } else You("finish eating the %s.", singular(victual.piece, xname));
  1153. X  
  1154. X          if(victual.piece->otyp == CORPSE)
  1155. X!         cpostfx(victual.piece->corpsenm);
  1156. X          else
  1157. X!         fpostfx(victual.piece);
  1158. X  
  1159. X!         if (carried(victual.piece)) useup(victual.piece);
  1160. X!         else useupf(victual.piece);
  1161. X          victual.piece = (struct obj *) 0;
  1162. X          victual.fullwarn = victual.eating = victual.doreset = 
  1163. X          victual.canchoke = FALSE;
  1164. X!         return(0);
  1165. X      }
  1166. X  }
  1167. X  
  1168. X***************
  1169. X*** 243,249 ****
  1170. X  register int pm;
  1171. X  {
  1172. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  1173. X!         You("cannibal!  You will be sorry for this!");
  1174. X          Aggravate_monster |= INTRINSIC;
  1175. X      }
  1176. X  
  1177. X--- 286,292 ----
  1178. X  register int pm;
  1179. X  {
  1180. X      if ((pl_character[0]=='E') ? is_elf(&mons[pm]) : is_human(&mons[pm])) {
  1181. X!         You("cannibal!    You will regret this!");
  1182. X          Aggravate_monster |= INTRINSIC;
  1183. X      }
  1184. X  
  1185. X***************
  1186. X*** 270,275 ****
  1187. X--- 313,325 ----
  1188. X  #ifdef POLYSELF
  1189. X          }
  1190. X          break;
  1191. X+         case PM_LIZARD:
  1192. X+         /* Relief from cockatrices -dgk */
  1193. X+         if (Stoned) {
  1194. X+             Stoned = 0;
  1195. X+             You("feel limber!");
  1196. X+         }
  1197. X+         break;
  1198. X          default:
  1199. X  
  1200. X          if(dmgtype(&mons[pm], AD_ACID) && Stoned) {
  1201. X***************
  1202. X*** 281,291 ****
  1203. X      return;
  1204. X  }
  1205. X  
  1206. X! static int
  1207. X  cpostfx(pm)        /* called after completely consuming a corpse */
  1208. X  register int pm;
  1209. X  {
  1210. X!     register int tmp = 0, tp = 0;
  1211. X  
  1212. X      switch(pm) {
  1213. X          case PM_WRAITH:
  1214. X--- 331,341 ----
  1215. X      return;
  1216. X  }
  1217. X  
  1218. X! static void
  1219. X  cpostfx(pm)        /* called after completely consuming a corpse */
  1220. X  register int pm;
  1221. X  {
  1222. X!     register int tmp = 0;
  1223. X  
  1224. X      switch(pm) {
  1225. X          case PM_WRAITH:
  1226. X***************
  1227. X*** 334,342 ****
  1228. X          case PM_SMALL_MIMIC:
  1229. X          tmp += 20;
  1230. X          if(u.usym == S_HUMAN) {
  1231. X!             You("cannot resist the temptation to mimic a treasure chest.");
  1232. X!             nomul(tmp);
  1233. X!             tp++;
  1234. X              afternmv = Meatdone;
  1235. X              if (pl_character[0]=='E')
  1236. X              nomovemsg = "You now again prefer mimicking an elf.";
  1237. X--- 384,391 ----
  1238. X          case PM_SMALL_MIMIC:
  1239. X          tmp += 20;
  1240. X          if(u.usym == S_HUMAN) {
  1241. X!             You("cannot resist the temptation to mimic a pile of gold.");
  1242. X!             nomul(-tmp);
  1243. X              afternmv = Meatdone;
  1244. X              if (pl_character[0]=='E')
  1245. X              nomovemsg = "You now again prefer mimicking an elf.";
  1246. X***************
  1247. X*** 363,368 ****
  1248. X--- 412,421 ----
  1249. X              You("seem faster.");
  1250. X          }
  1251. X          break;
  1252. X+         case PM_LIZARD:
  1253. X+         if (HStun > 2)  make_stunned(2L,FALSE);
  1254. X+         if (HConfusion > 2)  make_confused(2L,FALSE);
  1255. X+         break;
  1256. X  #ifdef POLYSELF
  1257. X          case PM_CHAMELEON:
  1258. X          You("feel a change coming over you.");
  1259. X***************
  1260. X*** 427,440 ****
  1261. X          }
  1262. X          break;
  1263. X      }
  1264. X!     return(tp);
  1265. X  }
  1266. X  
  1267. X! static int
  1268. X! opentin() {        /* called during each move whilst opening a tin */
  1269. X      register int r;
  1270. X  
  1271. X!     if(!carried(tin.tin))        /* perhaps it was stolen? */
  1272. X          return(0);        /* %% probably we should use tinoid */
  1273. X      if(tin.usedtime++ >= 50) {
  1274. X          You("give up your attempt to open the tin.");
  1275. X--- 480,498 ----
  1276. X          }
  1277. X          break;
  1278. X      }
  1279. X!     return;
  1280. X  }
  1281. X  
  1282. X! #ifndef OVERLAY
  1283. X! static 
  1284. X! #endif
  1285. X! int
  1286. X! opentin()        /* called during each move whilst opening a tin */
  1287. X! {
  1288. X      register int r;
  1289. X  
  1290. X!     if(!carried(tin.tin) && !obj_here(tin.tin, u.ux, u.uy))
  1291. X!                     /* perhaps it was stolen? */
  1292. X          return(0);        /* %% probably we should use tinoid */
  1293. X      if(tin.usedtime++ >= 50) {
  1294. X          You("give up your attempt to open the tin.");
  1295. X***************
  1296. X*** 444,451 ****
  1297. X          return(1);        /* still busy */
  1298. X      if(tin.tin->cursed && !rn2(8)) {
  1299. X          b_trapped("tin");
  1300. X!         useup(tin.tin);
  1301. X!         return(0);
  1302. X      }
  1303. X      You("succeed in opening the tin.");
  1304. X      if(!tin.tin->spe) {
  1305. X--- 502,508 ----
  1306. X          return(1);        /* still busy */
  1307. X      if(tin.tin->cursed && !rn2(8)) {
  1308. X          b_trapped("tin");
  1309. X!         goto use_me;
  1310. X      }
  1311. X      You("succeed in opening the tin.");
  1312. X      if(!tin.tin->spe) {
  1313. X***************
  1314. X*** 452,459 ****
  1315. X          if(tin.tin->corpsenm == -1) {
  1316. X          pline("It turns out to be empty.");
  1317. X          tin.tin->dknown = tin.tin->known = TRUE;
  1318. X!         useup(tin.tin);
  1319. X!         return(0);
  1320. X          }
  1321. X          r = tin.tin->cursed ? 4 : rn2(TTSZ-1); /* Always rotten if cursed */
  1322. X          pline("It smells like %s.", makeplural(
  1323. X--- 509,515 ----
  1324. X          if(tin.tin->corpsenm == -1) {
  1325. X          pline("It turns out to be empty.");
  1326. X          tin.tin->dknown = tin.tin->known = TRUE;
  1327. X!         goto use_me;
  1328. X          }
  1329. X          r = tin.tin->cursed ? 4 : rn2(TTSZ-1); /* Always rotten if cursed */
  1330. X          pline("It smells like %s.", makeplural(
  1331. X***************
  1332. X*** 461,473 ****
  1333. X          pline("Eat it? ");
  1334. X          if (yn() == 'n') {
  1335. X          if (!Hallucination) tin.tin->dknown = tin.tin->known = TRUE;
  1336. X!         useup(tin.tin);
  1337. X!         return 0;
  1338. X          }
  1339. X          You("consume %s %s.", tintxts[r].txt,
  1340. X            mons[tin.tin->corpsenm].mname);
  1341. X          tin.tin->dknown = tin.tin->known = TRUE;
  1342. X!         cprefx(tin.tin->corpsenm); (void) cpostfx(tin.tin->corpsenm);
  1343. X  
  1344. X          /* check for vomiting added by GAN 01/16/87 */
  1345. X          if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE);
  1346. X--- 517,529 ----
  1347. X          pline("Eat it? ");
  1348. X          if (yn() == 'n') {
  1349. X          if (!Hallucination) tin.tin->dknown = tin.tin->known = TRUE;
  1350. X!         if (flags.verbose) You("discard the open tin.");
  1351. X!         goto use_me;
  1352. X          }
  1353. X          You("consume %s %s.", tintxts[r].txt,
  1354. X            mons[tin.tin->corpsenm].mname);
  1355. X          tin.tin->dknown = tin.tin->known = TRUE;
  1356. X!         cprefx(tin.tin->corpsenm); cpostfx(tin.tin->corpsenm);
  1357. X  
  1358. X          /* check for vomiting added by GAN 01/16/87 */
  1359. X          if(tintxts[r].nut < 0) make_vomiting((long)rn1(15,10), FALSE);
  1360. X***************
  1361. X*** 483,496 ****
  1362. X          pline("It contains some decaying %s substance.",
  1363. X              Hallucination ? hcolor() : green);
  1364. X          else
  1365. X!         pline("It contains spinach - this makes you feel like %s!",
  1366. X!             Hallucination ? "Swee'pea" : "Popeye");
  1367. X  
  1368. X          lesshungry(600);
  1369. X          gainstr(tin.tin, 0);
  1370. X      }
  1371. X      tin.tin->dknown = tin.tin->known = TRUE;
  1372. X!     useup(tin.tin);
  1373. X      return(0);
  1374. X  }
  1375. X  
  1376. X--- 539,564 ----
  1377. X          pline("It contains some decaying %s substance.",
  1378. X              Hallucination ? hcolor() : green);
  1379. X          else
  1380. X!         pline("It contains spinach.");
  1381. X  
  1382. X+         pline("Eat it? ");
  1383. X+         if (yn() == 'n') {
  1384. X+         if (!Hallucination && !tin.tin->cursed)
  1385. X+             tin.tin->dknown = tin.tin->known = TRUE;
  1386. X+         if (flags.verbose)
  1387. X+             You("discard the open tin.");
  1388. X+         goto use_me;
  1389. X+         }
  1390. X+         if (!tin.tin->cursed)
  1391. X+         pline("This makes you feel like %s!",
  1392. X+               Hallucination ? "Swee'pea" : "Popeye");
  1393. X          lesshungry(600);
  1394. X          gainstr(tin.tin, 0);
  1395. X      }
  1396. X      tin.tin->dknown = tin.tin->known = TRUE;
  1397. X! use_me:
  1398. X!     if (carried(tin.tin)) useup(tin.tin);
  1399. X!     else useupf(tin.tin);
  1400. X      return(0);
  1401. X  }
  1402. X  
  1403. X***************
  1404. X*** 538,544 ****
  1405. X                  obj = splitobj(otmp, 1);
  1406. X                  if(otmp == uwep) setuwep(obj);
  1407. X              }
  1408. X!             dropx(otmp);
  1409. X              return;
  1410. X          }
  1411. X          tmp = 10 + rn2(1 + 500/((int)(ACURR(A_DEX) + ACURR(A_STR))));
  1412. X--- 606,613 ----
  1413. X                  obj = splitobj(otmp, 1);
  1414. X                  if(otmp == uwep) setuwep(obj);
  1415. X              }
  1416. X!             if (carried(otmp)) dropx(otmp);
  1417. X!             else stackobj(otmp);
  1418. X              return;
  1419. X          }
  1420. X          tmp = 10 + rn2(1 + 500/((int)(ACURR(A_DEX) + ACURR(A_STR))));
  1421. X***************
  1422. X*** 586,602 ****
  1423. X      register struct obj *otmp;
  1424. X  {
  1425. X      register char *cname = mons[otmp->corpsenm].mname;
  1426. X!     register int tp, rotted;
  1427. X  
  1428. X      tp = 0;
  1429. X! #ifdef LINT    /* problem if more than 320K moves before try to eat */
  1430. X!     rotted = 0;
  1431. X! #else
  1432. X!     rotted = (monstermoves - otmp->age)/((long)(10 + rn2(20)));
  1433. X  #endif
  1434. X  
  1435. X!     if(otmp->cursed) rotted += 2;
  1436. X!     else if (otmp->blessed) rotted -= 2;
  1437. X  
  1438. X      if(otmp->corpsenm != PM_ACID_BLOB && (rotted > 5)) {
  1439. X          tp++;
  1440. X--- 655,672 ----
  1441. X      register struct obj *otmp;
  1442. X  {
  1443. X      register char *cname = mons[otmp->corpsenm].mname;
  1444. X!     register int tp, rotted = 0;
  1445. X  
  1446. X      tp = 0;
  1447. X! 
  1448. X!     if(otmp->corpsenm != PM_LIZARD) {
  1449. X! #ifndef LINT    /* problem if more than 320K moves before try to eat */
  1450. X!         rotted = (monstermoves - otmp->age)/((long)(10 + rn2(20)));
  1451. X  #endif
  1452. X  
  1453. X!         if(otmp->cursed) rotted += 2;
  1454. X!         else if (otmp->blessed) rotted -= 2;
  1455. X!     }
  1456. X  
  1457. X      if(otmp->corpsenm != PM_ACID_BLOB && (rotted > 5)) {
  1458. X          tp++;
  1459. X***************
  1460. X*** 615,621 ****
  1461. X  #ifdef POLYSELF
  1462. X          }
  1463. X  #endif
  1464. X!         useup(otmp);
  1465. X          return(1);
  1466. X      } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)){
  1467. X          tp++;
  1468. X--- 685,692 ----
  1469. X  #ifdef POLYSELF
  1470. X          }
  1471. X  #endif
  1472. X!         if (carried(otmp)) useup(otmp);
  1473. X!         else useupf(otmp);
  1474. X          return(1);
  1475. X      } else if(poisonous(&mons[otmp->corpsenm]) && rn2(5)){
  1476. X          tp++;
  1477. X***************
  1478. X*** 634,646 ****
  1479. X          You("feel%s sick.", (Sick) ? " very" : "");
  1480. X          losehp(rnd(8), "cadaver");
  1481. X      }
  1482. X!     if(!tp && !rn2(7)) {
  1483. X  
  1484. X          if(rottenfood()) {
  1485. X          (void)touchfood(otmp);
  1486. X          return(1);
  1487. X          }
  1488. X!         victual.nutrit = (int)mons[otmp->corpsenm].cnutrit >> 2;
  1489. X      } else {
  1490. X  #ifdef POLYSELF
  1491. X          pline("That %s corpse %s!", cname,
  1492. X--- 705,718 ----
  1493. X          You("feel%s sick.", (Sick) ? " very" : "");
  1494. X          losehp(rnd(8), "cadaver");
  1495. X      }
  1496. X!     if(!tp && otmp->corpsenm != PM_LIZARD && (otmp->orotten || !rn2(7))) {
  1497. X  
  1498. X          if(rottenfood()) {
  1499. X+         otmp->orotten = TRUE;
  1500. X          (void)touchfood(otmp);
  1501. X          return(1);
  1502. X          }
  1503. X!         otmp->oeaten >>= 2;
  1504. X      } else {
  1505. X  #ifdef POLYSELF
  1506. X          pline("That %s corpse %s!", cname,
  1507. X***************
  1508. X*** 648,657 ****
  1509. X  #else
  1510. X          pline("That %s corpse tasted terrible!", cname);
  1511. X  #endif
  1512. X-         victual.nutrit = (int)mons[otmp->corpsenm].cnutrit;
  1513. X      }
  1514. X  
  1515. X!     /* delay is weight dependant */
  1516. X      victual.reqtime = 3 + (mons[otmp->corpsenm].cwt >> 2);
  1517. X      return(0);
  1518. X  }
  1519. X--- 720,728 ----
  1520. X  #else
  1521. X          pline("That %s corpse tasted terrible!", cname);
  1522. X  #endif
  1523. X      }
  1524. X  
  1525. X!     /* delay is weight dependent */
  1526. X      victual.reqtime = 3 + (mons[otmp->corpsenm].cwt >> 2);
  1527. X      return(0);
  1528. X  }
  1529. X***************
  1530. X*** 661,670 ****
  1531. X      register struct obj *otmp;
  1532. X  {
  1533. X  #ifdef DEBUG
  1534. X!     pline("start_eating: %x (victual = %x)", otmp, victual.piece);
  1535. X!     pline("reqtime = %d", victual.reqtime);
  1536. X!     pline("nutrit = %d", victual.nutrit);
  1537. X!     pline("nmod = %d", victual.nmod);
  1538. X  #endif
  1539. X      victual.fullwarn = victual.doreset = FALSE;
  1540. X      victual.canchoke = (u.uhs == SATIATED);
  1541. X--- 732,742 ----
  1542. X      register struct obj *otmp;
  1543. X  {
  1544. X  #ifdef DEBUG
  1545. X!     debug("start_eating: %lx (victual = %lx)", otmp, victual.piece);
  1546. X!     debug("reqtime = %d", victual.reqtime);
  1547. X!     debug("(original reqtime = %d)", objects[otmp->otyp].oc_delay);
  1548. X!     debug("nmod = %d", victual.nmod);
  1549. X!     debug("oeaten = %d", otmp->oeaten);
  1550. X  #endif
  1551. X      victual.fullwarn = victual.doreset = FALSE;
  1552. X      victual.canchoke = (u.uhs == SATIATED);
  1553. X***************
  1554. X*** 673,679 ****
  1555. X      if (otmp->otyp == CORPSE)
  1556. X          cprefx(victual.piece->corpsenm);
  1557. X  
  1558. X!     Sprintf(msgbuf, "eating the %s", singular(otmp));
  1559. X      set_occupation(eatfood, msgbuf, 0);
  1560. X  }
  1561. X  
  1562. X--- 745,751 ----
  1563. X      if (otmp->otyp == CORPSE)
  1564. X          cprefx(victual.piece->corpsenm);
  1565. X  
  1566. X!     Sprintf(msgbuf, "eating the %s", singular(otmp, xname));
  1567. X      set_occupation(eatfood, msgbuf, 0);
  1568. X  }
  1569. X  
  1570. X***************
  1571. X*** 711,723 ****
  1572. X              make_vomiting((long)rn1(victual.reqtime, 10), FALSE);
  1573. X          }
  1574. X          break;
  1575. X-         case DEAD_LIZARD:
  1576. X-         /* Relief from cockatrices -dgk */
  1577. X-         if (Stoned) {
  1578. X-             Stoned = 0;
  1579. X-             You("feel limber!");
  1580. X-         }
  1581. X-         break;
  1582. X  #ifdef POLYSELF
  1583. X          case CLOVE_OF_GARLIC:
  1584. X          if (is_undead(uasmon)) {
  1585. X--- 783,788 ----
  1586. X***************
  1587. X*** 764,770 ****
  1588. X      }
  1589. X  }
  1590. X  
  1591. X! static int
  1592. X  fpostfx(otmp)        /* called after consuming (non-corpse) food */
  1593. X  
  1594. X      register struct obj *otmp;
  1595. X--- 829,835 ----
  1596. X      }
  1597. X  }
  1598. X  
  1599. X! static void
  1600. X  fpostfx(otmp)        /* called after consuming (non-corpse) food */
  1601. X  
  1602. X      register struct obj *otmp;
  1603. X***************
  1604. X*** 780,789 ****
  1605. X          }
  1606. X          break;
  1607. X  #endif
  1608. X-         case DEAD_LIZARD:
  1609. X-         if (HStun > 2)  make_stunned(2L,FALSE);
  1610. X-         if (HConfusion > 2)  make_confused(2L,FALSE);
  1611. X-         break;
  1612. X          case CARROT:
  1613. X          make_blinded(0L,TRUE);
  1614. X          break;
  1615. X--- 845,850 ----
  1616. X***************
  1617. X*** 816,837 ****
  1618. X          }
  1619. X          break;
  1620. X      }
  1621. X!     return(0);    /* must do this for sync with cpostfx() */
  1622. X  }
  1623. X  
  1624. X  int
  1625. X  doeat() {        /* generic "eat" command funtion (see cmd.c) */
  1626. X      register struct obj *otmp;
  1627. X  
  1628. X!     if(victual.piece &&
  1629. X!        (carried(victual.piece) ||
  1630. X!         (victual.piece->ox == u.ux && victual.piece->oy == u.uy))) {
  1631. X  
  1632. X          You("resume your meal.");
  1633. X          if(!carried(victual.piece)) {
  1634. X          if(victual.piece->quan != 1)
  1635. X              (void) splitobj(victual.piece, 1);
  1636. X-         victual.piece = pick_obj(victual.piece);
  1637. X          }
  1638. X          start_eating(victual.piece);
  1639. X          return(1);
  1640. X--- 877,897 ----
  1641. X          }
  1642. X          break;
  1643. X      }
  1644. X!     return;
  1645. X  }
  1646. X  
  1647. X  int
  1648. X  doeat() {        /* generic "eat" command funtion (see cmd.c) */
  1649. X      register struct obj *otmp;
  1650. X+     int basenutrit;         /* nutrition of full item */
  1651. X  
  1652. X!     if (!(otmp = floorfood("eat", 0))) return 0;
  1653. X  
  1654. X+     if(otmp == victual.piece) {
  1655. X          You("resume your meal.");
  1656. X          if(!carried(victual.piece)) {
  1657. X          if(victual.piece->quan != 1)
  1658. X              (void) splitobj(victual.piece, 1);
  1659. X          }
  1660. X          start_eating(victual.piece);
  1661. X          return(1);
  1662. X***************
  1663. X*** 838,845 ****
  1664. X      }
  1665. X  
  1666. X      /* nothing in progress - so try to find something. */
  1667. X-     if (!(otmp = floorfood("eat", 0))) return 0;
  1668. X- 
  1669. X      /* tins are a special case */
  1670. X      if(otmp->otyp == TIN) {
  1671. X          start_tin(otmp);
  1672. X--- 898,903 ----
  1673. X***************
  1674. X*** 846,851 ****
  1675. X--- 904,912 ----
  1676. X          return(1);
  1677. X      }
  1678. X  
  1679. X+     victual.piece = otmp = touchfood(otmp);
  1680. X+     victual.usedtime = 0;
  1681. X+ 
  1682. X      /* Now we need to calculate delay and nutritional info.
  1683. X       * The base nutrition calculated here and in eatcorpse() accounts
  1684. X       * for normal vs. rotten food.  The reqtime and nutrit values are
  1685. X***************
  1686. X*** 853,888 ****
  1687. X       */
  1688. X      if(otmp->otyp == CORPSE) {
  1689. X          if(eatcorpse(otmp)) return(1);
  1690. X!         /* else eatcorpse sets up reqtime and nutrit */
  1691. X      } else {
  1692. X          victual.reqtime = objects[otmp->otyp].oc_delay;
  1693. X!         victual.nutrit = objects[otmp->otyp].nutrition;
  1694. X!         if (otmp->otyp != FORTUNE_COOKIE && otmp->otyp != DEAD_LIZARD &&
  1695. X          (otmp->cursed ||
  1696. X           ((monstermoves - otmp->age) > otmp->blessed ? 50 : 30)) &&
  1697. X!         !rn2(7)) {
  1698. X  
  1699. X          if(rottenfood()) {
  1700. X!             (void)touchfood(otmp);
  1701. X              return(1);
  1702. X          }
  1703. X!         victual.nutrit /= 2;
  1704. X          } else fprefx(otmp);
  1705. X      }
  1706. X  
  1707. X!     victual.piece = otmp;
  1708. X!     victual.usedtime = 0;
  1709. X! 
  1710. X!     /* re-calc the nutrition (already set) to account for weight */
  1711. X!     if(otmp->oeaten) {
  1712. X!         int baseweight = weight(otmp);    /* weight of full item */
  1713. X! 
  1714. X!         victual.reqtime = 
  1715. X!         rounddiv((int)(victual.reqtime * otmp->owt), baseweight);
  1716. X!         victual.nutrit = 
  1717. X!         rounddiv((int)(victual.nutrit * otmp->owt), baseweight);
  1718. X!     }
  1719. X  
  1720. X      /* calculate the modulo value (nutrit. units per round eating)
  1721. X       * note: this isn't exact - you actually lose a little nutrition
  1722. X       *     due to this method.
  1723. X--- 914,948 ----
  1724. X       */
  1725. X      if(otmp->otyp == CORPSE) {
  1726. X          if(eatcorpse(otmp)) return(1);
  1727. X!         /* else eatcorpse sets up reqtime and oeaten */
  1728. X      } else {
  1729. X          victual.reqtime = objects[otmp->otyp].oc_delay;
  1730. X!         if (otmp->otyp != FORTUNE_COOKIE &&
  1731. X          (otmp->cursed ||
  1732. X           ((monstermoves - otmp->age) > otmp->blessed ? 50 : 30)) &&
  1733. X!         (otmp->orotten || !rn2(7))) {
  1734. X  
  1735. X          if(rottenfood()) {
  1736. X!             otmp->orotten = TRUE;
  1737. X              return(1);
  1738. X          }
  1739. X!         otmp->oeaten /= 2;
  1740. X          } else fprefx(otmp);
  1741. X      }
  1742. X  
  1743. X!     /* re-calc the nutrition */
  1744. X!     if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit;
  1745. X!     else basenutrit = objects[otmp->otyp].nutrition;
  1746. X  
  1747. X+ #ifdef DEBUG
  1748. X+     debug("before rounddiv: victual.reqtime == %d", victual.reqtime);
  1749. X+     debug("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit);
  1750. X+ #endif
  1751. X+     victual.reqtime = (basenutrit == 0 ? 0 :
  1752. X+       (int)rounddiv(victual.reqtime * (long)otmp->oeaten,(long)basenutrit));
  1753. X+ #ifdef DEBUG
  1754. X+     debug("after rounddiv: victual.reqtime == %d", victual.reqtime);
  1755. X+ #endif
  1756. X      /* calculate the modulo value (nutrit. units per round eating)
  1757. X       * note: this isn't exact - you actually lose a little nutrition
  1758. X       *     due to this method.
  1759. X***************
  1760. X*** 889,901 ****
  1761. X       * TODO: add in a "remainder" value to be given at the end of the
  1762. X       *     meal.
  1763. X       */
  1764. X!     if(victual.nutrit == 0 || victual.reqtime == 0)
  1765. X          /* possible if most has been eaten before */
  1766. X          victual.nmod = 0;
  1767. X!     else if(victual.nutrit > victual.reqtime)
  1768. X!         victual.nmod = -(victual.nutrit / victual.reqtime);
  1769. X      else
  1770. X!         victual.nmod = victual.reqtime % victual.nutrit;
  1771. X  
  1772. X      start_eating(otmp);
  1773. X      return(1);
  1774. X--- 949,961 ----
  1775. X       * TODO: add in a "remainder" value to be given at the end of the
  1776. X       *     meal.
  1777. X       */
  1778. X!     if(victual.reqtime == 0)
  1779. X          /* possible if most has been eaten before */
  1780. X          victual.nmod = 0;
  1781. X!     else if (otmp->oeaten > victual.reqtime)
  1782. X!         victual.nmod = -(otmp->oeaten / victual.reqtime);
  1783. X      else
  1784. X!         victual.nmod = victual.reqtime % otmp->oeaten;
  1785. X  
  1786. X      start_eating(otmp);
  1787. X      return(1);
  1788. X***************
  1789. X*** 938,949 ****
  1790. X  register int num;
  1791. X  {
  1792. X  #ifdef DEBUG
  1793. X!     pline("lesshungry(%d)", num);
  1794. X  #endif
  1795. X      u.uhunger += num;
  1796. X      if(u.uhunger >= 2000) {
  1797. X!         if (!victual.eating || victual.canchoke)
  1798. X          choke((struct obj *) 0);
  1799. X      } else {
  1800. X          /* Have lesshungry() report when you're nearly full so all eating
  1801. X           * warns when you're about to choke.
  1802. X--- 998,1011 ----
  1803. X  register int num;
  1804. X  {
  1805. X  #ifdef DEBUG
  1806. X!     debug("lesshungry(%d)", num);
  1807. X  #endif
  1808. X      u.uhunger += num;
  1809. X      if(u.uhunger >= 2000) {
  1810. X!         if (!victual.eating || victual.canchoke) {
  1811. X          choke((struct obj *) 0);
  1812. X+         reset_eat(); /* stop eating if they were lifesaved */
  1813. X+         }
  1814. X      } else {
  1815. X          /* Have lesshungry() report when you're nearly full so all eating
  1816. X           * warns when you're about to choke.
  1817. X***************
  1818. X*** 957,963 ****
  1819. X          else {
  1820. X              victual.fullwarn = TRUE;
  1821. X              if (victual.canchoke) {
  1822. X!             pline("Stop eating?");
  1823. X              if(yn() == 'y') reset_eat();
  1824. X              }
  1825. X          }
  1826. X--- 1019,1025 ----
  1827. X          else {
  1828. X              victual.fullwarn = TRUE;
  1829. X              if (victual.canchoke) {
  1830. X!             pline("Stop eating? ");
  1831. X              if(yn() == 'y') reset_eat();
  1832. X              }
  1833. X          }
  1834. X***************
  1835. X*** 967,973 ****
  1836. X      newuhs(FALSE);
  1837. X  }
  1838. X  
  1839. X! static int
  1840. X  unfaint() {
  1841. X      (void) Hear_again();
  1842. X      u.uhs = FAINTING;
  1843. X--- 1029,1038 ----
  1844. X      newuhs(FALSE);
  1845. X  }
  1846. X  
  1847. X! #ifndef OVERLAY
  1848. X! static 
  1849. X! #endif
  1850. X! int
  1851. X  unfaint() {
  1852. X      (void) Hear_again();
  1853. X      u.uhs = FAINTING;
  1854. X***************
  1855. X*** 1045,1050 ****
  1856. X--- 1110,1118 ----
  1857. X      }
  1858. X  }
  1859. X  
  1860. X+ /* Returns an object representing food.  Object may be either on floor or
  1861. X+  * in inventory.
  1862. X+  */
  1863. X  struct obj *
  1864. X  floorfood(verb,corpseonly)    /* get food from floor or pack */
  1865. X      char *verb;
  1866. X***************
  1867. X*** 1060,1070 ****
  1868. X                  (otmp->quan == 1) ? "is" : "are",
  1869. X                  doname(otmp), verb,
  1870. X                  (otmp->quan == 1) ? "it" : "one");
  1871. X!             if(yn() == 'y') {
  1872. X!                 if(otmp->quan != 1)
  1873. X!                     (void) splitobj(otmp, 1);
  1874. X!                 return(pick_obj(otmp));
  1875. X!             }
  1876. X          }
  1877. X          }
  1878. X      }
  1879. X--- 1128,1135 ----
  1880. X                  (otmp->quan == 1) ? "is" : "are",
  1881. X                  doname(otmp), verb,
  1882. X                  (otmp->quan == 1) ? "it" : "one");
  1883. X!             if(yn() == 'y')
  1884. X!                 return(otmp);
  1885. X          }
  1886. X          }
  1887. X      }
  1888. X***************
  1889. X*** 1078,1081 ****
  1890. X--- 1143,1158 ----
  1891. X  vomit() {        /* A good idea from David Neves */
  1892. X      make_sick(0L,TRUE);
  1893. X      nomul(-2);
  1894. X+ }
  1895. X+ 
  1896. X+ int
  1897. X+ eaten_stat(base, obj)
  1898. X+ register int base;
  1899. X+ register struct obj *obj;
  1900. X+ {
  1901. X+     base *= obj->oeaten;
  1902. X+ 
  1903. X+     if (obj->otyp == CORPSE) base /= mons[obj->corpsenm].cnutrit;
  1904. X+     else base /= objects[obj->otyp].nutrition;
  1905. X+     return (base < 1) ? 1 : base;
  1906. X  }
  1907. X*** src/Old/end.c    Sun Nov 19 12:39:59 1989
  1908. X--- src/end.c    Sun Nov  5 16:15:57 1989
  1909. X***************
  1910. X*** 15,21 ****
  1911. X  
  1912. X  void end_box_display();
  1913. X  
  1914. X! static const char *deaths[] = {     /* the array of death */
  1915. X      "died", "choked", "poisoned", "starvation", "drowning",
  1916. X      "burning", "crushed", "turned to stone", "genocided",
  1917. X      "panic", "trickery",
  1918. X--- 15,21 ----
  1919. X  
  1920. X  void end_box_display();
  1921. X  
  1922. X! static const char *deaths[] = {        /* the array of death */
  1923. X      "died", "choked", "poisoned", "starvation", "drowning",
  1924. X      "burning", "crushed", "turned to stone", "genocided",
  1925. X      "panic", "trickery",
  1926. X***************
  1927. X*** 44,50 ****
  1928. X          return 0;
  1929. X      }
  1930. X      return done2();
  1931. X! } 
  1932. X  
  1933. X  int
  1934. X  done2()
  1935. X--- 44,50 ----
  1936. X          return 0;
  1937. X      }
  1938. X      return done2();
  1939. X! }
  1940. X  
  1941. X  int
  1942. X  done2()
  1943. X***************
  1944. X*** 198,204 ****
  1945. X      Vprintf(str,VA_ARGS);
  1946. X      more();                /* contains a fflush() */
  1947. X  #if defined(WIZARD) && (defined(UNIX) || defined(VMS))
  1948. X!     if (wizard)    
  1949. X  # ifdef SYSV
  1950. X          (void)
  1951. X  # endif
  1952. X--- 198,204 ----
  1953. X      Vprintf(str,VA_ARGS);
  1954. X      more();                /* contains a fflush() */
  1955. X  #if defined(WIZARD) && (defined(UNIX) || defined(VMS))
  1956. X!     if (wizard)
  1957. X  # ifdef SYSV
  1958. X          (void)
  1959. X  # endif
  1960. X***************
  1961. X*** 243,254 ****
  1962. X                !Blind ? "begins to glow" : "feels warm");
  1963. X          You("feel much better!");
  1964. X          pline("The medallion crumbles to dust!");
  1965. X!         if (uamul)    /* Huss:  Check if amulet really is worn */
  1966. X!             useup(uamul);
  1967. X!         else if (uwep && uwep->otyp == AMULET_OF_LIFE_SAVING)
  1968. X!             useup(uwep);    /* Oops, he must be wielding it. */
  1969. X!         else
  1970. X!             impossible("Using an amulet without having it?");
  1971. X          if (u.uhunger < 500) u.uhunger = 500;
  1972. X          nomovemsg = "You survived that attempt on your life.";
  1973. X          curs_on_u();
  1974. X--- 243,249 ----
  1975. X                !Blind ? "begins to glow" : "feels warm");
  1976. X          You("feel much better!");
  1977. X          pline("The medallion crumbles to dust!");
  1978. X!         useup(uamul);
  1979. X          if (u.uhunger < 500) u.uhunger = 500;
  1980. X          nomovemsg = "You survived that attempt on your life.";
  1981. X          curs_on_u();
  1982. X***************
  1983. X*** 367,373 ****
  1984. X      if(!done_stopprint)
  1985. X          Printf("Goodbye %s the %s...\n\n", buf2,
  1986. X  #ifdef ENDGAME
  1987. X!            how != ASCENDED ? pl_character : 
  1988. X             flags.female ? "Demigoddess" : "Demigod");
  1989. X  #else
  1990. X             pl_character);
  1991. X--- 362,368 ----
  1992. X      if(!done_stopprint)
  1993. X          Printf("Goodbye %s the %s...\n\n", buf2,
  1994. X  #ifdef ENDGAME
  1995. X!            how != ASCENDED ? pl_character :
  1996. X             flags.female ? "Demigoddess" : "Demigod");
  1997. X  #else
  1998. X             pl_character);
  1999. X***************
  2000. X*** 441,447 ****
  2001. X                      doname(otmp), i);
  2002. X              } else if(otmp->olet == AMULET_SYM) {
  2003. X                  otmp->known = 1;
  2004. X!                 i = (otmp->spe < 0) ? 2 : 
  2005. X                      otmp->otyp == AMULET_OF_YENDOR ?
  2006. X                              5000 : 500;
  2007. X                  u.urexp += i;
  2008. X--- 436,442 ----
  2009. X                      doname(otmp), i);
  2010. X              } else if(otmp->olet == AMULET_SYM) {
  2011. X                  otmp->known = 1;
  2012. X!                 i = (otmp->spe < 0) ? 2 :
  2013. X                      otmp->otyp == AMULET_OF_YENDOR ?
  2014. X                              5000 : 500;
  2015. X                  u.urexp += i;
  2016. X***************
  2017. X*** 459,465 ****
  2018. X              if (how != ASCENDED) {
  2019. X              if(dlevel == ENDLEVEL)
  2020. X                   Printf("in the endgame ");
  2021. X!                 else Printf("on dungeon level %d ", dlevel);
  2022. X              }
  2023. X  #else
  2024. X              Printf("on dungeon level %d ", dlevel);
  2025. X--- 454,460 ----
  2026. X              if (how != ASCENDED) {
  2027. X              if(dlevel == ENDLEVEL)
  2028. X                   Printf("in the endgame ");
  2029. X!             else Printf("on dungeon level %d ", dlevel);
  2030. X              }
  2031. X  #else
  2032. X              Printf("on dungeon level %d ", dlevel);
  2033. X***************
  2034. X*** 498,505 ****
  2035. X      if (ramdisk)
  2036. X          eraseall(permbones, alllevels);
  2037. X  #else
  2038. X! # if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS)) || defined(VMS) \
  2039. X!                             || defined(MACOS)
  2040. X      register int x;
  2041. X  #  if defined(UNIX) || defined(VMS)
  2042. X      (void) signal(SIGHUP,SIG_IGN);
  2043. X--- 493,499 ----
  2044. X      if (ramdisk)
  2045. X          eraseall(permbones, alllevels);
  2046. X  #else
  2047. X! # if defined(UNIX) || (defined(MSDOS) && !defined(OLD_TOS)) || defined(VMS) || defined(MACOS)
  2048. X      register int x;
  2049. X  #  if defined(UNIX) || defined(VMS)
  2050. X      (void) signal(SIGHUP,SIG_IGN);
  2051. X***************
  2052. X*** 528,534 ****
  2053. X  end_box_display()
  2054. X  {
  2055. X      register struct obj *box, *obj;
  2056. X-     int boxcnt = 0;
  2057. X      char buf[BUFSZ];
  2058. X  
  2059. X      for(box=invent; box; box=box->nobj) {
  2060. X--- 522,527 ----
  2061. X***************
  2062. X*** 539,548 ****
  2063. X              if (obj->cobj == box) {
  2064. X              if (!cnt) {
  2065. X                  Sprintf(buf, "Contents of the %s:",xname(box));
  2066. X!                 if (!boxcnt)
  2067. X!                 cornline(0, buf);
  2068. X!                 else
  2069. X!                 cornline(1, buf);
  2070. X              }
  2071. X              makeknown(obj->otyp);
  2072. X              obj->known = obj->bknown = obj->dknown = 1;
  2073. X--- 532,538 ----
  2074. X              if (obj->cobj == box) {
  2075. X              if (!cnt) {
  2076. X                  Sprintf(buf, "Contents of the %s:",xname(box));
  2077. X!                 cornline(0, buf);
  2078. X              }
  2079. X              makeknown(obj->otyp);
  2080. X              obj->known = obj->bknown = obj->dknown = 1;
  2081. X***************
  2082. X*** 551,565 ****
  2083. X              }
  2084. X          }
  2085. X          if (!cnt) {
  2086. X!             Sprintf(buf, "The %s is empty.", xname(box));
  2087. X!             if (!boxcnt)
  2088. X!             cornline(0, buf);
  2089. X!             else
  2090. X!             cornline(1, buf);
  2091. X!         } else
  2092. X!             cornline(1," ");
  2093. X!         boxcnt++;
  2094. X          }
  2095. X      }
  2096. X-     if (boxcnt) cornline(2,"");
  2097. X  }
  2098. X--- 541,549 ----
  2099. X              }
  2100. X          }
  2101. X          if (!cnt) {
  2102. X!             pline("The %s is empty.", xname(box));
  2103. X!             more();
  2104. X!         } else cornline(2,"");
  2105. X          }
  2106. X      }
  2107. X  }
  2108. X*** src/Old/engrave.c    Sun Nov 19 12:40:26 1989
  2109. X--- src/engrave.c    Fri Nov 17 19:31:37 1989
  2110. X***************
  2111. X*** 1,4 ****
  2112. X! /*    SCCS Id: @(#)engrave.c    3.0    89/06/12
  2113. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2114. X  /* NetHack may be freely redistributed.  See license for details. */
  2115. X  
  2116. X--- 1,4 ----
  2117. X! /*    SCCS Id: @(#)engrave.c    3.0    89/11/15
  2118. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2119. X  /* NetHack may be freely redistributed.  See license for details. */
  2120. X  
  2121. X***************
  2122. X*** 11,24 ****
  2123. X      unsigned engr_lth;    /* for save & restore; not length of text */
  2124. X      long engr_time;    /* moment engraving was (will be) finished */
  2125. X      xchar engr_type;
  2126. X! #define    DUST    1
  2127. X! #define    ENGRAVE    2
  2128. X! #define    BURN    3
  2129. X  #define MARK    4
  2130. X  #define POLY    5    /* temporary type - for polymorphing engraving */
  2131. X  } *head_engr;
  2132. X  
  2133. X! static void del_engr P((struct engr *));
  2134. X  
  2135. X  /* random engravings */
  2136. X  const char *random_engr[] =
  2137. X--- 11,24 ----
  2138. X      unsigned engr_lth;    /* for save & restore; not length of text */
  2139. X      long engr_time;    /* moment engraving was (will be) finished */
  2140. X      xchar engr_type;
  2141. X! #define DUST    1
  2142. X! #define ENGRAVE    2
  2143. X! #define BURN    3
  2144. X  #define MARK    4
  2145. X  #define POLY    5    /* temporary type - for polymorphing engraving */
  2146. X  } *head_engr;
  2147. X  
  2148. X! static void FDECL(del_engr, (struct engr *));
  2149. X  
  2150. X  /* random engravings */
  2151. X  const char *random_engr[] =
  2152. END_OF_FILE
  2153. if test 55539 -ne `wc -c <'patches06f'`; then
  2154.     echo shar: \"'patches06f'\" unpacked with wrong size!
  2155. fi
  2156. # end of 'patches06f'
  2157. fi
  2158. echo shar: End of archive 3 \(of 15\).
  2159. cp /dev/null ark3isdone
  2160. MISSING=""
  2161. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  2162.     if test ! -f ark${I}isdone ; then
  2163.     MISSING="${MISSING} ${I}"
  2164.     fi
  2165. done
  2166. if test "${MISSING}" = "" ; then
  2167.     echo You have unpacked all 15 archives.
  2168.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2169. else
  2170.     echo You still need to unpack the following archives:
  2171.     echo "        " ${MISSING}
  2172. fi
  2173. ##  End of shell archive.
  2174. exit 0
  2175.